#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
	int boy[110];
	int girl[110];
	int flag[110];
	memset(flag,0,sizeof(flag));
	int n;
	int ans = 0;
	cin>>n;
	for(int i = 0;i<n;i++) cin>>boy[i];
	int m;
	cin>>m;
	for(int i = 0;i<m;i++) cin>>girl[i];
	sort(boy,boy+n);
	sort(girl,girl+m);
	for(int i = 0;i<n;i++)
	for(int j = 0;j<m;j++)
	{
		if(!flag[j]&&abs(boy[i]-girl[j])<=1)
		{
			ans++;
			flag[j] = 1;
			break;
		}
	}
	cout<<ans<<endl;
}
